<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template name="lf2br">
 <xsl:param name="text"/>
 <xsl:choose>
   <xsl:when test="contains($text,'&#10;')">
     <xsl:value-of select="substring-before($text,'&#10;')"/>
     <br/>
     <xsl:call-template name="lf2br">
       <xsl:with-param name="text">
         <xsl:value-of select="substring-after($text,'&#10;')"/>
       </xsl:with-param>
     </xsl:call-template>
   </xsl:when>
   <xsl:otherwise>
     <xsl:value-of select="$text"/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:template>

<xsl:template match="galleryEntry[@activityid &gt; 0]">
<!-- Insert appropriate Validation
-->

		<table class="body" border="0" cellspacing="0" cellpadding="0" width="100%" >
		<tr>
		<td width="15px" height="15px"><img src="http://imgs.goparty.it/gallery/ctsx.gif"/></td>
		<td bgcolor="#EEC867">&#160;</td>
		<td width="15px" height="15px"><img src="http://imgs.goparty.it/gallery/ctdx.gif"/></td>
		</tr>
		<tr>
		<td bgcolor="#EEC867" width="15px" height="15px"></td>
		<td bgcolor="#EEC867">
<xsl:comment>
0 - have just been created
1 - is public
2 - have been denyed authorization
3 - is waiting for authorization
4 - is waiting for authorization after change
</xsl:comment>

<div class="b10b" style="float:right;">
		<xsl:choose>
			<xsl:when test="@loggedUser = @userid or floor( @loggedStatus div 32 ) mod 2">
				<a href="?gid={@gid}&amp;edit=1"><u>Modifica descrizione</u></a>
			</xsl:when>
			<xsl:otherwise>
				<span class="fakeA"><u>Modifica descrizione</u></span>
			</xsl:otherwise>
		</xsl:choose>
</div>
<div class="b10b" style="float:right;width:70px;padding-right:10px;">
		<xsl:choose>
			<xsl:when test="@loggedUser = @userid or floor( @loggedStatus div 32 ) mod 2">
				<xsl:choose>
					<xsl:when test="@public=0">
						<a href="/userinfo/photo.aspx?gid={@gid}&amp;publish=1"><b><u>Publish</u></b></a>
					</xsl:when>
					<xsl:when test="@public=1">
						<a href="?gid={@gid}&amp;makeItPublic=0"><b><u>Turn&#160;offline!</u></b></a>
					</xsl:when>
					<xsl:when test="@public=2">
						Approvazione negata!
					</xsl:when>
					<xsl:when test="@public=3 or @public=4">
						In attesa di<br/>approvazione
					</xsl:when>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<xsl:choose>
					<xsl:when test="@public=0">
						<span class="fakeA"><b><u>Publish</u></b></span>
					</xsl:when>
					<xsl:when test="@public=1">
						<span class="fakeA"><b><u>Turn&#160;offline!</u></b></span>
					</xsl:when>
					<xsl:when test="@public=2">
						Approvazione negata!
					</xsl:when>
					<xsl:when test="@public=3 or @public=4">
						In attesa di<br/>approvazione
					</xsl:when>
				</xsl:choose>
			</xsl:otherwise>
		</xsl:choose>
</div>

<div style="clear:left;padding-top:15px;"><b><xsl:value-of select="substring(@duedate,1,10)"/></b></div>
<div style=""><b><xsl:value-of select="@title"/>
&#160;<span style="text-transform:capitalize;">(
<xsl:choose>
<xsl:when test='@lid &gt; 0'>
	<xsl:value-of select="/galleryEntry/venue[@lid = /galleryEntry/@lid]/@cityname"/>
</xsl:when>
<xsl:when test='string-length(@cityname) &gt; 0'>
	<xsl:value-of select="@cityname"/>
</xsl:when>
<xsl:otherwise>
	<xsl:value-of select="@placeName"/>
</xsl:otherwise>
</xsl:choose>
)</span></b></div>
<div style="padding-top:5px;">
	<xsl:value-of select="@descr" disable-output-escaping="yes"/>
</div>
<div style="padding-top:10px;"><b>Presenti: <xsl:value-of select="@liveppl"/></b></div>

<div style="clear:left;">
			<HR ALIGN="center" WIDTH="100%"/><p/>
			<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="">
			<input type="hidden" name="FORM_ID" value="ADDPIC"></input>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="FILE" SIZE="90" NAME="FILE2"></INPUT>
			<br/>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="FILE" SIZE="90" NAME="FILE3"></INPUT>
			<br/>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="FILE" SIZE="90" NAME="FILE4"></INPUT>
			<br/>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="FILE" SIZE="90" NAME="FILE5"></INPUT>
			<br/>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="FILE" SIZE="90" NAME="FILE6"></INPUT>
			<br/>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="FILE" SIZE="90" NAME="FILE7"></INPUT>
			<br/>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="FILE" SIZE="90" NAME="FILE8"></INPUT>
			<br/>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="FILE" SIZE="90" NAME="FILE9"></INPUT>
			<br/>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="FILE" SIZE="90" NAME="FILE10"></INPUT>
			<br/>

			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="SUBMIT" VALUE="Aggiungi le foto!"></INPUT>
			</FORM>
</div>

		</td>
		<td bgcolor="#EEC867" width="15px" height="15px"></td>
		</tr>
		<tr>
		<td width="15px" height="15px"><img src="http://imgs.goparty.it/gallery/cbsx.gif"/></td>
		<td bgcolor="#EEC867">&#160;</td>
		<td width="15px" height="15px"><img src="http://imgs.goparty.it/gallery/cbdx.gif"/></td>
		</tr>
		</table>

<xsl:variable name="cols" select="4"/>
<table border="0" width="100%" style="margin-top:10px;">
	<xsl:for-each select="picture[(position() mod $cols) = 1]"> 
		<tr> 
		<xsl:for-each select=".|following-sibling::picture[position() &lt; $cols]"> 
			<td align="center" style="padding-bottom:15px;">
				<a href="http://imgs.goparty.it/gallery/splash/{@picname}" target="new" class="body"><img border="0" src="http://imgs.goparty.it/gallery/thumb/{@picname}"/></a>
						<center>
						<FORM style="display: inline;" METHOD="POST" ENCTYPE="multipart/form-data" ACTION="">
						<input type="hidden" name="FORM_ID" value="DELETEPIC"></input>
						<input type="hidden" name="FILE2DELETE" value="{@picname}"></input>
						<input type="hidden" name="PID" value="{@pid}"></input>
						<INPUT style="cursor:pointer;" class="gSLink" TYPE="SUBMIT" VALUE="elimina"></INPUT>
						</FORM>
						</center>
			</td> 
		</xsl:for-each> 
		</tr> 
	</xsl:for-each> 
</table>

</xsl:template>



<xsl:template match="galleryEntry[@activityid &lt; 0]">

<!-- Insert appropriate Validation
-->

		<table class="body" border="0" cellspacing="0" cellpadding="0" width="100%" >
		<tr>
		<td width="15px" height="15px"><img src="http://imgs.goparty.it/gallery/ctsx.gif"/></td>
		<td bgcolor="#EEC867">&#160;</td>
		<td width="15px" height="15px"><img src="http://imgs.goparty.it/gallery/ctdx.gif"/></td>
		</tr>
		<tr>
		<td bgcolor="#EEC867" width="15px" height="15px"></td>
		<td bgcolor="#EEC867">


<div class="b10b" style="float:right;"><a href="?gid={@gid}&amp;edit=1"><u>Modifica descrizione</u></a></div>
<div class="b10b" style="float:right;width:70px;padding-right:10px;">
<a href="/userinfo/photo.aspx?gid={@gid}&amp;publish=1"><b><u>Publish</u></b></a>
</div>
<div class="b10b" style="clear:left;padding-top:15px;"><b><xsl:value-of select="substring(@duedate,1,10)"/></b></div>
<div class="b10b" style=""><b><xsl:value-of select="@title"/></b></div>
<div class="b10b" style="padding-top:5px;">
		<xsl:call-template name="lf2br">
		<xsl:with-param name="text" select="@descr"/>
		</xsl:call-template>
</div>


<div style="clear:left;">
			<HR ALIGN="center" WIDTH="100%"/><p/>
			<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="">
			<input type="hidden" name="FORM_ID" value="ADDPIC4PHOTO"></input>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="FILE" SIZE="90" NAME="FILE2"></INPUT>
			<br/>

			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="SUBMIT" VALUE="Aggiungi la foto!"></INPUT>
			</FORM>
</div>

		</td>
		<td bgcolor="#EEC867" width="15px" height="15px"></td>
		</tr>
		<tr>
		<td width="15px" height="15px"><img src="http://imgs.goparty.it/gallery/cbsx.gif"/></td>
		<td bgcolor="#EEC867">&#160;</td>
		<td width="15px" height="15px"><img src="http://imgs.goparty.it/gallery/cbdx.gif"/></td>
		</tr>
		</table>

<xsl:variable name="cols" select="4"/>
<table border="0" width="100%" style="margin-top:10px;">
	<xsl:for-each select="picture[(position() mod $cols) = 1]"> 
		<tr> 
		<xsl:for-each select=".|following-sibling::picture[position() &lt; $cols]"> 
			<td align="center" style="padding-bottom:15px;">
				<a href="http://imgs.goparty.it/gallery/splash/{@picname}" target="new" class="body"><img border="0" src="http://imgs.goparty.it/gallery/thumb/{@picname}"/></a>
						<center>
						<FORM style="display: inline;" METHOD="POST" ENCTYPE="multipart/form-data" ACTION="">
						<input type="hidden" name="FORM_ID" value="DELETEPIC"></input>
						<input type="hidden" name="FILE2DELETE" value="{@picname}"></input>
						<input type="hidden" name="PID" value="{@pid}"></input>
						<INPUT class="gSLink" TYPE="SUBMIT" VALUE="elimina"></INPUT>
						</FORM>
						</center>
			</td> 
		</xsl:for-each> 
		</tr> 
	</xsl:for-each> 
</table>

</xsl:template>

<xsl:template match="picture">
	<div style="position: relative; padding: 10px; left: 10px; top: 10px; float: right;">
	<a href="http://imgs.goparty.it/gallery/splash/{@picname}" target="new" class="body"><img border="0" src="http://imgs.goparty.it/gallery/thumb/{@picname}"/></a>
			<center>
			<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="">
			<input type="hidden" name="FORM_ID" value="DELETEPIC"></input>
			<input type="hidden" name="FILE2DELETE" value="{@picname}"></input>
			<INPUT style="font-family:tahoma; font-size:7pt; color:black;" TYPE="SUBMIT" VALUE="Cancella la foto!"></INPUT>
			</FORM>
			</center>
	</div>
</xsl:template>


</xsl:stylesheet>